home *** CD-ROM | disk | FTP | other *** search
- Path: news.u-net.com!news
- From: charlotte@parmo.u-net.com (Thomas Christensen)
- Newsgroups: comp.lang.c++
- Subject: Re: Derived class not calling overloaded base class function
- Date: Fri, 23 Feb 1996 09:55:47 GMT
- Organization: U-NET limited
- Message-ID: <4gk310$pqt@nuntius.u-net.net>
- References: <4g46t2$3vd@otis.netspace.net.au>
- Reply-To: thc@mailhost.net
- NNTP-Posting-Host: parmo.u-net.com
- X-Newsreader: Forte Free Agent v0.55
-
- TorrBoy@Netspace.net.au (Peter J. Torr) wrote:
-
- >Hi,
-
- >Hopefully a very simple question someone can answer for me!
-
- >I have a class, say 'foo' (everyone's favourite) which has a member function
- >'int Get(void)'
-
- >I then derive a class (say 'goo') which has as a base class foo. If goo has a
- >function also called Get, but with different params (say ''char *Get(char *)') I can't
- >seem to get the base class' Get() function to operate within the derived class.
-
- >If I say just plain "Get()" it says too few parameters (for Get(char *)". If I use
- >"::Get()" the compiler complains Get should have a prototype. If I say "foo.Get()" it
- >says improper use of typedef foo. The only way seems to be to explicitly cast the
- >this pointer to a foo.
-
- >Surely there is a better way than this? Thanks for any help (e-mail preferred)
-
- >Peter
-
- Hi Peter
-
- Have you tried foo::Get() ?
-
- Thomas Christensen
- E-mail: thc@mailhost.net
-
-